\input ../../default-cn-cfg.mkvi
\setupcaption[table][location=top,suffix=\floatcaptionsuffix]

%%%
\definextable[generalxtable][
split=yes,header=repeat,footer=repeat,
foregroundstyle=\rm\tfx,%设置正文字体 ,\setupframed参数
textwidth=10cm,option=stretch,align={middle,lohi},
frame=on,rulethickness=0.1pt
]

\definextable[headrow][generalxtable][
foregroundcolor=red,
foregroundstyle=\ss\tfx,%设置正文字体 ,\setupframed参数
]

\definextable[footrow][generalxtable][
foregroundcolor=blue,
foregroundstyle=\rm\fsx,%设置正文字体 ,\setupframed参数
]

%%%%

\starttext
\dorecurse{1}{ \input ../../hetangyuese/htys01.mkvi}
\startplacefloat[table][title=最简单表格,location={left}]
  \startxtable[generalxtable]
    \startxtablehead[headrow]
      \startxrow
        \startxcell[nr=2]  科目
        \stopxcell
        \startxcell  表头
        \stopxcell
        \startxcell  数量
        \stopxcell
        \startxcell  表头 4
        \stopxcell
      \stopxrow
      \startxrow
        \startxcell
        \stopxcell
        \startxcell  米
        \stopxcell
        \startxcell
        \stopxcell
      \stopxrow

    \stopxtablehead
    \startxtablefoot[footrow]
      \startxrow
        \startxcell  表脚 1
        \stopxcell
        \startxcell  表脚 2
        \stopxcell
        \startxcell  表脚 3
        \stopxcell
        \startxcell  表脚 4
        \stopxcell
      \stopxrow
    \stopxtablefoot
    \startxtablebody
      \dorecurse{10}{
      \startxrow
        \startxcell[nc=2]  \color[darkgray]{ 合并单元格 行\low{\recurselevel}格1}
        \stopxcell
        % \startxcell  行\low{\recurselevel}格2 \stopxcell
        \startxcell  行\low{\recurselevel}格3
        \stopxcell
        \startxcell  行\low{\recurselevel}格4
        \stopxcell
      \stopxrow
    }
    \stopxtablebody
  \stopxtable
\stopplacefloat

\dorecurse{2}{ \input ../../hetangyuese/htys01.mkvi}
\stoptext
